﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataAccessLayer
{
    public partial class RoomClean
    {
        public static List<RoomClean> ToList_IncludeDeleted(linqDatabaseDataContext db)
        {
            return ((from u in db.RoomCleans orderby u.CreateTimestamp select u).ToList());
        }

        public static List<RoomClean> ToListByRoomID_IncludeDeleted(linqDatabaseDataContext db, int RoomID)
        {
            return ((from u in db.RoomCleans where u.RoomID == RoomID orderby u.CreateTimestamp select u).ToList());
        }

        public static List<RoomClean> ToList(linqDatabaseDataContext db)
        {
            return ((from u in db.RoomCleans where !u.Remove orderby u.CreateTimestamp select u).ToList());
        }

        public static List<RoomClean> ToListByRoomID(linqDatabaseDataContext db, int RoomID)
        {
            return ((from u in db.RoomCleans where !u.Remove && u.RoomID == RoomID orderby u.CreateTimestamp select u).ToList());
        }

        public static RoomClean LastByRoomID(linqDatabaseDataContext db, int RoomID)
        {
            return ((from u in db.RoomCleans where !u.Remove && u.RoomID == RoomID orderby u.CreateTimestamp select u).LastOrDefault());
        }
    }
}
